<?php

// Create page object
$transaction_grid = new ctransaction_grid();
$MasterPage =& $Page;
$Page =& $transaction_grid;

// Page init
$transaction_grid->Page_Init();

// Page main
$transaction_grid->Page_Main();
?>
<?php if ($transaction->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var transaction_grid = new ew_Page("transaction_grid");

// page properties
transaction_grid.PageID = "grid"; // page ID
transaction_grid.FormID = "ftransactiongrid"; // form ID
var EW_PAGE_ID = transaction_grid.PageID; // for backward compatibility

// extend page with ValidateForm function
transaction_grid.ValidateForm = function(fobj) {
	ew_PostAutoSuggest(fobj);
	if (!this.ValidateRequired)
		return true; // ignore validation
	if (fobj.a_confirm && fobj.a_confirm.value == "F")
		return true;
	var i, elm, aelm, infix;
	var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
	var addcnt = 0;
	for (i=0; i<rowcnt; i++) {
		infix = (fobj.key_count) ? String(i+1) : "";
		var chkthisrow = true;
		if (fobj.a_list && fobj.a_list.value == "gridinsert")
			chkthisrow = !(this.EmptyRow(fobj, infix));
		else
			chkthisrow = true;
		if (chkthisrow) {
			addcnt += 1;
		elm = fobj.elements["x" + infix + "_status_transaction"];
		if (elm && !ew_HasValue(elm))
			return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($transaction->status_transaction->FldCaption()) ?>");

		// Set up row object
		var row = {};
		row["index"] = infix;
		for (var j = 0; j < fobj.elements.length; j++) {
			var el = fobj.elements[j];
			var len = infix.length + 2;
			if (el.name.substr(0, len) == "x" + infix + "_") {
				var elname = "x_" + el.name.substr(len);
				if (ewLang.isObject(row[elname])) { // already exists
					if (ewLang.isArray(row[elname])) {
						row[elname][row[elname].length] = el; // add to array
					} else {
						row[elname] = [row[elname], el]; // convert to array
					}
				} else {
					row[elname] = el;
				}
			}
		}
		fobj.row = row;

		// Call Form Custom Validate event
		if (!this.Form_CustomValidate(fobj)) return false;
		} // End Grid Add checking
	}
	return true;
}

// Extend page with empty row check
transaction_grid.EmptyRow = function(fobj, infix) {
	if (ew_ValueChanged(fobj, infix, "order_no", false)) return false;
	if (ew_ValueChanged(fobj, infix, "user_id", false)) return false;
	if (ew_ValueChanged(fobj, infix, "amount", false)) return false;
	if (ew_ValueChanged(fobj, infix, "status_payment", false)) return false;
	if (ew_ValueChanged(fobj, infix, "status_transaction", false)) return false;
	if (ew_ValueChanged(fobj, infix, "total_item", false)) return false;
	if (ew_ValueChanged(fobj, infix, "total_weight", false)) return false;
	if (ew_ValueChanged(fobj, infix, "postage_price", false)) return false;
	if (ew_ValueChanged(fobj, infix, "items_price", false)) return false;
	if (ew_ValueChanged(fobj, infix, "type_price", false)) return false;
	if (ew_ValueChanged(fobj, infix, "shipping_address_id", false)) return false;
	if (ew_ValueChanged(fobj, infix, "isInvalid", false)) return false;
	if (ew_ValueChanged(fobj, infix, "remarks", false)) return false;
	if (ew_ValueChanged(fobj, infix, "consignment_no", false)) return false;
	return true;
}

// extend page with Form_CustomValidate function
transaction_grid.Form_CustomValidate =  
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
<?php if (EW_CLIENT_VALIDATE) { ?>
transaction_grid.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
transaction_grid.ValidateRequired = false; // no JavaScript validation
<?php } ?>

//-->
</script>
<?php } ?>
<?php
if ($transaction->CurrentAction == "gridadd") {
	if ($transaction->CurrentMode == "copy") {
		$bSelectLimit = EW_SELECT_LIMIT;
		if ($bSelectLimit) {
			$transaction_grid->TotalRecs = $transaction->SelectRecordCount();
			$transaction_grid->Recordset = $transaction_grid->LoadRecordset($transaction_grid->StartRec-1, $transaction_grid->DisplayRecs);
		} else {
			if ($transaction_grid->Recordset = $transaction_grid->LoadRecordset())
				$transaction_grid->TotalRecs = $transaction_grid->Recordset->RecordCount();
		}
		$transaction_grid->StartRec = 1;
		$transaction_grid->DisplayRecs = $transaction_grid->TotalRecs;
	} else {
		$transaction->CurrentFilter = "0=1";
		$transaction_grid->StartRec = 1;
		$transaction_grid->DisplayRecs = $transaction->GridAddRowCount;
	}
	$transaction_grid->TotalRecs = $transaction_grid->DisplayRecs;
	$transaction_grid->StopRec = $transaction_grid->DisplayRecs;
} else {
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$transaction_grid->TotalRecs = $transaction->SelectRecordCount();
	} else {
		if ($transaction_grid->Recordset = $transaction_grid->LoadRecordset())
			$transaction_grid->TotalRecs = $transaction_grid->Recordset->RecordCount();
	}
	$transaction_grid->StartRec = 1;
	$transaction_grid->DisplayRecs = $transaction_grid->TotalRecs; // Display all records
	if ($bSelectLimit)
		$transaction_grid->Recordset = $transaction_grid->LoadRecordset($transaction_grid->StartRec-1, $transaction_grid->DisplayRecs);
}
?>
<p class="phpmaker ewTitle" style="white-space: nowrap;"><?php if ($transaction->CurrentMode == "add" || $transaction->CurrentMode == "copy") { ?><?php echo $Language->Phrase("Add") ?><?php } elseif ($transaction->CurrentMode == "edit") { ?><?php echo $Language->Phrase("Edit") ?><?php } ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $transaction->TableCaption() ?></p>
</p>
<?php $transaction_grid->ShowPageHeader(); ?>
<?php
$transaction_grid->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div id="gmp_transaction" class="ewGridMiddlePanel">
<table cellspacing="0" data-rowhighlightclass="ewTableHighlightRow" data-rowselectclass="ewTableSelectRow" data-roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $transaction->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$transaction_grid->RenderListOptions();

// Render list options (header, left)
$transaction_grid->ListOptions->Render("header", "left");
?>
<?php if ($transaction->order_no->Visible) { // order_no ?>
	<?php if ($transaction->SortUrl($transaction->order_no) == "") { ?>
		<td><?php echo $transaction->order_no->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->order_no->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->order_no->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->order_no->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->user_id->Visible) { // user_id ?>
	<?php if ($transaction->SortUrl($transaction->user_id) == "") { ?>
		<td><?php echo $transaction->user_id->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->user_id->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->user_id->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->user_id->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->amount->Visible) { // amount ?>
	<?php if ($transaction->SortUrl($transaction->amount) == "") { ?>
		<td><?php echo $transaction->amount->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->amount->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->amount->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->amount->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->status_payment->Visible) { // status_payment ?>
	<?php if ($transaction->SortUrl($transaction->status_payment) == "") { ?>
		<td><?php echo $transaction->status_payment->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->status_payment->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->status_payment->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->status_payment->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->status_transaction->Visible) { // status_transaction ?>
	<?php if ($transaction->SortUrl($transaction->status_transaction) == "") { ?>
		<td><?php echo $transaction->status_transaction->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->status_transaction->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->status_transaction->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->status_transaction->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->total_item->Visible) { // total_item ?>
	<?php if ($transaction->SortUrl($transaction->total_item) == "") { ?>
		<td><?php echo $transaction->total_item->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->total_item->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->total_item->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->total_item->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->total_weight->Visible) { // total_weight ?>
	<?php if ($transaction->SortUrl($transaction->total_weight) == "") { ?>
		<td><?php echo $transaction->total_weight->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->total_weight->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->total_weight->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->total_weight->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->postage_price->Visible) { // postage_price ?>
	<?php if ($transaction->SortUrl($transaction->postage_price) == "") { ?>
		<td><?php echo $transaction->postage_price->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->postage_price->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->postage_price->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->postage_price->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->items_price->Visible) { // items_price ?>
	<?php if ($transaction->SortUrl($transaction->items_price) == "") { ?>
		<td><?php echo $transaction->items_price->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->items_price->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->items_price->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->items_price->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->type_price->Visible) { // type_price ?>
	<?php if ($transaction->SortUrl($transaction->type_price) == "") { ?>
		<td><?php echo $transaction->type_price->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->type_price->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->type_price->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->type_price->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->shipping_address_id->Visible) { // shipping_address_id ?>
	<?php if ($transaction->SortUrl($transaction->shipping_address_id) == "") { ?>
		<td><?php echo $transaction->shipping_address_id->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->shipping_address_id->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->shipping_address_id->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->shipping_address_id->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->isInvalid->Visible) { // isInvalid ?>
	<?php if ($transaction->SortUrl($transaction->isInvalid) == "") { ?>
		<td><?php echo $transaction->isInvalid->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->isInvalid->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->isInvalid->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->isInvalid->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->remarks->Visible) { // remarks ?>
	<?php if ($transaction->SortUrl($transaction->remarks) == "") { ?>
		<td><?php echo $transaction->remarks->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->remarks->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->remarks->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->remarks->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($transaction->consignment_no->Visible) { // consignment_no ?>
	<?php if ($transaction->SortUrl($transaction->consignment_no) == "") { ?>
		<td><?php echo $transaction->consignment_no->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $transaction->consignment_no->FldCaption() ?></td><td style="width: 10px;"><?php if ($transaction->consignment_no->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($transaction->consignment_no->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$transaction_grid->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
$transaction_grid->StartRec = 1;
$transaction_grid->StopRec = $transaction_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($objForm) {
	$objForm->Index = 0;
	if ($objForm->HasValue("key_count") && ($transaction->CurrentAction == "gridadd" || $transaction->CurrentAction == "gridedit" || $transaction->CurrentAction == "F")) {
		$transaction_grid->KeyCount = $objForm->GetValue("key_count");
		$transaction_grid->StopRec = $transaction_grid->KeyCount;
	}
}
$transaction_grid->RecCnt = $transaction_grid->StartRec - 1;
if ($transaction_grid->Recordset && !$transaction_grid->Recordset->EOF) {
	$transaction_grid->Recordset->MoveFirst();
	if (!$bSelectLimit && $transaction_grid->StartRec > 1)
		$transaction_grid->Recordset->Move($transaction_grid->StartRec - 1);
} elseif (!$transaction->AllowAddDeleteRow && $transaction_grid->StopRec == 0) {
	$transaction_grid->StopRec = $transaction->GridAddRowCount;
}

// Initialize aggregate
$transaction->RowType = EW_ROWTYPE_AGGREGATEINIT;
$transaction->ResetAttrs();
$transaction_grid->RenderRow();
$transaction_grid->RowCnt = 0;
if ($transaction->CurrentAction == "gridadd")
	$transaction_grid->RowIndex = 0;
if ($transaction->CurrentAction == "gridedit")
	$transaction_grid->RowIndex = 0;
while ($transaction_grid->RecCnt < $transaction_grid->StopRec) {
	$transaction_grid->RecCnt++;
	if (intval($transaction_grid->RecCnt) >= intval($transaction_grid->StartRec)) {
		$transaction_grid->RowCnt++;
		if ($transaction->CurrentAction == "gridadd" || $transaction->CurrentAction == "gridedit" || $transaction->CurrentAction == "F")
			$transaction_grid->RowIndex++;

		// Set up key count
		$transaction_grid->KeyCount = $transaction_grid->RowIndex;

		// Init row class and style
		$transaction->ResetAttrs();
		$transaction->CssClass = "";
		if ($transaction->CurrentAction == "gridadd") {
			if ($transaction->CurrentMode == "copy") {
				$transaction_grid->LoadRowValues($transaction_grid->Recordset); // Load row values
				$transaction_grid->SetRecordKey($transaction_grid->RowOldKey, $transaction_grid->Recordset); // Set old record key
			} else {
				$transaction_grid->LoadDefaultValues(); // Load default values
				$transaction_grid->RowOldKey = ""; // Clear old key value
			}
		} elseif ($transaction->CurrentAction == "gridedit") {
			$transaction_grid->LoadRowValues($transaction_grid->Recordset); // Load row values
		}
		$transaction->RowType = EW_ROWTYPE_VIEW; // Render view
		if ($transaction->CurrentAction == "gridadd") // Grid add
			$transaction->RowType = EW_ROWTYPE_ADD; // Render add
		if ($transaction->CurrentAction == "gridadd" && $transaction->EventCancelled) // Insert failed
			$transaction_grid->RestoreCurrentRowFormValues($transaction_grid->RowIndex); // Restore form values
		if ($transaction->CurrentAction == "gridedit") { // Grid edit
			if ($transaction->EventCancelled) {
				$transaction_grid->RestoreCurrentRowFormValues($transaction_grid->RowIndex); // Restore form values
			}
			if ($transaction_grid->RowAction == "insert")
				$transaction->RowType = EW_ROWTYPE_ADD; // Render add
			else
				$transaction->RowType = EW_ROWTYPE_EDIT; // Render edit
		}
		if ($transaction->CurrentAction == "gridedit" && ($transaction->RowType == EW_ROWTYPE_EDIT || $transaction->RowType == EW_ROWTYPE_ADD) && $transaction->EventCancelled) // Update failed
			$transaction_grid->RestoreCurrentRowFormValues($transaction_grid->RowIndex); // Restore form values
		if ($transaction->RowType == EW_ROWTYPE_EDIT) // Edit row
			$transaction_grid->EditRowCnt++;
		if ($transaction->CurrentAction == "F") // Confirm row
			$transaction_grid->RestoreCurrentRowFormValues($transaction_grid->RowIndex); // Restore form values
		if ($transaction->RowType == EW_ROWTYPE_ADD || $transaction->RowType == EW_ROWTYPE_EDIT) { // Add / Edit row
			if ($transaction->CurrentAction == "edit") {
				$transaction->RowAttrs = array();
				$transaction->CssClass = "ewTableEditRow";
			} else {
				$transaction->RowAttrs = array();
			}
			if (!empty($transaction_grid->RowIndex))
				$transaction->RowAttrs = array_merge($transaction->RowAttrs, array('data-rowindex'=>$transaction_grid->RowIndex, 'id'=>'r' . $transaction_grid->RowIndex . '_transaction'));
		} else {
			$transaction->RowAttrs = array();
		}

		// Render row
		$transaction_grid->RenderRow();

		// Render list options
		$transaction_grid->RenderListOptions();

		// Skip delete row / empty row for confirm page
		if ($transaction_grid->RowAction <> "delete" && $transaction_grid->RowAction <> "insertdelete" && !($transaction_grid->RowAction == "insert" && $transaction->CurrentAction == "F" && $transaction_grid->EmptyRow())) {
?>
	<tr<?php echo $transaction->RowAttributes() ?>>
<?php

// Render list options (body, left)
$transaction_grid->ListOptions->Render("body", "left");
?>
	<?php if ($transaction->order_no->Visible) { // order_no ?>
		<td<?php echo $transaction->order_no->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_order_no" id="x<?php echo $transaction_grid->RowIndex ?>_order_no" size="70" maxlength="255" value="<?php echo $transaction->order_no->EditValue ?>"<?php echo $transaction->order_no->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_order_no" id="o<?php echo $transaction_grid->RowIndex ?>_order_no" value="<?php echo ew_HtmlEncode($transaction->order_no->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->order_no->ViewAttributes() ?>><?php echo $transaction->order_no->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_order_no" id="x<?php echo $transaction_grid->RowIndex ?>_order_no" value="<?php echo ew_HtmlEncode($transaction->order_no->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->order_no->ViewAttributes() ?>><?php echo $transaction->order_no->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_order_no" id="x<?php echo $transaction_grid->RowIndex ?>_order_no" value="<?php echo ew_HtmlEncode($transaction->order_no->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_order_no" id="o<?php echo $transaction_grid->RowIndex ?>_order_no" value="<?php echo ew_HtmlEncode($transaction->order_no->OldValue) ?>">
<?php } ?>
<a name="<?php echo $transaction_grid->PageObjName . "_row_" . $transaction_grid->RowCnt ?>" id="<?php echo $transaction_grid->PageObjName . "_row_" . $transaction_grid->RowCnt ?>"></a>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_id" id="o<?php echo $transaction_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($transaction->id->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { ?>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_id" id="x<?php echo $transaction_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($transaction->id->CurrentValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->user_id->Visible) { // user_id ?>
		<td<?php echo $transaction->user_id->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<?php if ($transaction->user_id->getSessionValue() <> "") { ?>
<div<?php echo $transaction->user_id->ViewAttributes() ?>><?php echo $transaction->user_id->ListViewValue() ?></div>
<input type="hidden" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->CurrentValue) ?>">
<?php } else { ?>
<span id="as_x<?php echo $transaction_grid->RowIndex ?>_user_id" style="white-space: nowrap; z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>">
	<input type="text" name="sv_x<?php echo $transaction_grid->RowIndex ?>_user_id" id="sv_x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $transaction->user_id->EditValue ?>" size="70"<?php echo $transaction->user_id->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $transaction_grid->RowIndex ?>_user_id" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $transaction_grid->RowIndex ?>_user_id" style="z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>"></div>
</span>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $transaction->user_id->CurrentValue ?>">
<?php
 $sSqlWrk = "SELECT `id`, `username`, `name`, `no_ahli` FROM `user`";
 $sWhereWrk = "`username`  LIKE '{query_value}%'";
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
	$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x<?php echo $transaction_grid->RowIndex ?>_user_id" id="s_x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $sSqlWrk ?>">
<script type="text/javascript">
<!--
var oas_x<?php echo $transaction_grid->RowIndex ?>_user_id = new ew_AutoSuggest("sv_x<?php echo $transaction_grid->RowIndex ?>_user_id", "sc_x<?php echo $transaction_grid->RowIndex ?>_user_id", "s_x<?php echo $transaction_grid->RowIndex ?>_user_id", "em_x<?php echo $transaction_grid->RowIndex ?>_user_id", "x<?php echo $transaction_grid->RowIndex ?>_user_id", "", false, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas_x<?php echo $transaction_grid->RowIndex ?>_user_id.formatResult = function(ar) {	
	var df1 = ar[1];
	var df2 = ar[2];
	if (df2 != "")
		df1 += EW_FIELD_SEP + df2;
	var df3 = ar[3];
	if (df3 != "")
		df1 += EW_FIELD_SEP + df3;
	return df1;
};
oas_x<?php echo $transaction_grid->RowIndex ?>_user_id.ac.typeAhead = false;

//-->
</script>
<?php } ?>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_user_id" id="o<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->user_id->ViewAttributes() ?>><?php echo $transaction->user_id->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->user_id->ViewAttributes() ?>><?php echo $transaction->user_id->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_user_id" id="o<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->amount->Visible) { // amount ?>
		<td<?php echo $transaction->amount->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_amount" id="x<?php echo $transaction_grid->RowIndex ?>_amount" size="30" maxlength="255" value="<?php echo $transaction->amount->EditValue ?>"<?php echo $transaction->amount->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_amount" id="o<?php echo $transaction_grid->RowIndex ?>_amount" value="<?php echo ew_HtmlEncode($transaction->amount->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->amount->ViewAttributes() ?>><?php echo $transaction->amount->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_amount" id="x<?php echo $transaction_grid->RowIndex ?>_amount" value="<?php echo ew_HtmlEncode($transaction->amount->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->amount->ViewAttributes() ?>><?php echo $transaction->amount->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_amount" id="x<?php echo $transaction_grid->RowIndex ?>_amount" value="<?php echo ew_HtmlEncode($transaction->amount->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_amount" id="o<?php echo $transaction_grid->RowIndex ?>_amount" value="<?php echo ew_HtmlEncode($transaction->amount->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->status_payment->Visible) { // status_payment ?>
		<td<?php echo $transaction->status_payment->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_status_payment" id="x<?php echo $transaction_grid->RowIndex ?>_status_payment" size="30" maxlength="255" value="<?php echo $transaction->status_payment->EditValue ?>"<?php echo $transaction->status_payment->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_status_payment" id="o<?php echo $transaction_grid->RowIndex ?>_status_payment" value="<?php echo ew_HtmlEncode($transaction->status_payment->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->status_payment->ViewAttributes() ?>><?php echo $transaction->status_payment->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_status_payment" id="x<?php echo $transaction_grid->RowIndex ?>_status_payment" value="<?php echo ew_HtmlEncode($transaction->status_payment->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->status_payment->ViewAttributes() ?>><?php echo $transaction->status_payment->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_status_payment" id="x<?php echo $transaction_grid->RowIndex ?>_status_payment" value="<?php echo ew_HtmlEncode($transaction->status_payment->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_status_payment" id="o<?php echo $transaction_grid->RowIndex ?>_status_payment" value="<?php echo ew_HtmlEncode($transaction->status_payment->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->status_transaction->Visible) { // status_transaction ?>
		<td<?php echo $transaction->status_transaction->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<div id="tp_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="{value}"<?php echo $transaction->status_transaction->EditAttributes() ?>></label></div>
<div id="dsl_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" data-repeatcolumn="5" class="ewItemList">
<?php
$arwrk = $transaction->status_transaction->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->status_transaction->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;

		// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $transaction->status_transaction->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
if (@$emptywrk) $transaction->status_transaction->OldValue = "";
?>
</div>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="o<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($transaction->status_transaction->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div id="tp_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="{value}"<?php echo $transaction->status_transaction->EditAttributes() ?>></label></div>
<div id="dsl_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" data-repeatcolumn="5" class="ewItemList">
<?php
$arwrk = $transaction->status_transaction->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->status_transaction->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;

		// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $transaction->status_transaction->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
if (@$emptywrk) $transaction->status_transaction->OldValue = "";
?>
</div>
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->status_transaction->ViewAttributes() ?>><?php echo $transaction->status_transaction->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($transaction->status_transaction->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="o<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($transaction->status_transaction->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->total_item->Visible) { // total_item ?>
		<td<?php echo $transaction->total_item->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_total_item" id="x<?php echo $transaction_grid->RowIndex ?>_total_item" size="30" maxlength="255" value="<?php echo $transaction->total_item->EditValue ?>"<?php echo $transaction->total_item->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_total_item" id="o<?php echo $transaction_grid->RowIndex ?>_total_item" value="<?php echo ew_HtmlEncode($transaction->total_item->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->total_item->ViewAttributes() ?>><?php echo $transaction->total_item->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_item" id="x<?php echo $transaction_grid->RowIndex ?>_total_item" value="<?php echo ew_HtmlEncode($transaction->total_item->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->total_item->ViewAttributes() ?>><?php echo $transaction->total_item->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_item" id="x<?php echo $transaction_grid->RowIndex ?>_total_item" value="<?php echo ew_HtmlEncode($transaction->total_item->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_total_item" id="o<?php echo $transaction_grid->RowIndex ?>_total_item" value="<?php echo ew_HtmlEncode($transaction->total_item->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->total_weight->Visible) { // total_weight ?>
		<td<?php echo $transaction->total_weight->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_total_weight" id="x<?php echo $transaction_grid->RowIndex ?>_total_weight" size="30" value="<?php echo $transaction->total_weight->EditValue ?>"<?php echo $transaction->total_weight->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_total_weight" id="o<?php echo $transaction_grid->RowIndex ?>_total_weight" value="<?php echo ew_HtmlEncode($transaction->total_weight->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->total_weight->ViewAttributes() ?>><?php echo $transaction->total_weight->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_weight" id="x<?php echo $transaction_grid->RowIndex ?>_total_weight" value="<?php echo ew_HtmlEncode($transaction->total_weight->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->total_weight->ViewAttributes() ?>><?php echo $transaction->total_weight->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_weight" id="x<?php echo $transaction_grid->RowIndex ?>_total_weight" value="<?php echo ew_HtmlEncode($transaction->total_weight->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_total_weight" id="o<?php echo $transaction_grid->RowIndex ?>_total_weight" value="<?php echo ew_HtmlEncode($transaction->total_weight->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->postage_price->Visible) { // postage_price ?>
		<td<?php echo $transaction->postage_price->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_postage_price" id="x<?php echo $transaction_grid->RowIndex ?>_postage_price" size="30" value="<?php echo $transaction->postage_price->EditValue ?>"<?php echo $transaction->postage_price->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_postage_price" id="o<?php echo $transaction_grid->RowIndex ?>_postage_price" value="<?php echo ew_HtmlEncode($transaction->postage_price->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->postage_price->ViewAttributes() ?>><?php echo $transaction->postage_price->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_postage_price" id="x<?php echo $transaction_grid->RowIndex ?>_postage_price" value="<?php echo ew_HtmlEncode($transaction->postage_price->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->postage_price->ViewAttributes() ?>><?php echo $transaction->postage_price->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_postage_price" id="x<?php echo $transaction_grid->RowIndex ?>_postage_price" value="<?php echo ew_HtmlEncode($transaction->postage_price->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_postage_price" id="o<?php echo $transaction_grid->RowIndex ?>_postage_price" value="<?php echo ew_HtmlEncode($transaction->postage_price->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->items_price->Visible) { // items_price ?>
		<td<?php echo $transaction->items_price->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_items_price" id="x<?php echo $transaction_grid->RowIndex ?>_items_price" size="30" value="<?php echo $transaction->items_price->EditValue ?>"<?php echo $transaction->items_price->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_items_price" id="o<?php echo $transaction_grid->RowIndex ?>_items_price" value="<?php echo ew_HtmlEncode($transaction->items_price->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->items_price->ViewAttributes() ?>><?php echo $transaction->items_price->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_items_price" id="x<?php echo $transaction_grid->RowIndex ?>_items_price" value="<?php echo ew_HtmlEncode($transaction->items_price->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->items_price->ViewAttributes() ?>><?php echo $transaction->items_price->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_items_price" id="x<?php echo $transaction_grid->RowIndex ?>_items_price" value="<?php echo ew_HtmlEncode($transaction->items_price->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_items_price" id="o<?php echo $transaction_grid->RowIndex ?>_items_price" value="<?php echo ew_HtmlEncode($transaction->items_price->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->type_price->Visible) { // type_price ?>
		<td<?php echo $transaction->type_price->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<div id="tp_x<?php echo $transaction_grid->RowIndex ?>_type_price" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="{value}"<?php echo $transaction->type_price->EditAttributes() ?>></label></div>
<div id="dsl_x<?php echo $transaction_grid->RowIndex ?>_type_price" data-repeatcolumn="5" class="ewItemList">
<?php
$arwrk = $transaction->type_price->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->type_price->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;

		// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $transaction->type_price->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
if (@$emptywrk) $transaction->type_price->OldValue = "";
?>
</div>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_type_price" id="o<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($transaction->type_price->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->type_price->ViewAttributes() ?>><?php echo $transaction->type_price->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($transaction->type_price->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->type_price->ViewAttributes() ?>><?php echo $transaction->type_price->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($transaction->type_price->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_type_price" id="o<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($transaction->type_price->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->shipping_address_id->Visible) { // shipping_address_id ?>
		<td<?php echo $transaction->shipping_address_id->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="as_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" style="white-space: nowrap; z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>">
	<input type="text" name="sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $transaction->shipping_address_id->EditValue ?>" size="30"<?php echo $transaction->shipping_address_id->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" style="z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>"></div>
</span>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $transaction->shipping_address_id->CurrentValue ?>">
<?php
 $sSqlWrk = "SELECT `id`, `address`, `poskod`, `city` FROM `address`";
 $sWhereWrk = "`address`  LIKE '{query_value}%'";
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
	$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $sSqlWrk ?>">
<script type="text/javascript">
<!--
var oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id = new ew_AutoSuggest("sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "sc_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "em_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "", false, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id.formatResult = function(ar) {	
	var df1 = ar[1];
	var df2 = ar[2];
	if (df2 != "")
		df1 += EW_FIELD_SEP + df2;
	var df3 = ar[3];
	if (df3 != "")
		df1 += EW_FIELD_SEP + df3;
	return df1;
};
oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id.ac.typeAhead = false;

//-->
</script>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="o<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo ew_HtmlEncode($transaction->shipping_address_id->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->shipping_address_id->ViewAttributes() ?>><?php echo $transaction->shipping_address_id->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo ew_HtmlEncode($transaction->shipping_address_id->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->shipping_address_id->ViewAttributes() ?>><?php echo $transaction->shipping_address_id->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo ew_HtmlEncode($transaction->shipping_address_id->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="o<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo ew_HtmlEncode($transaction->shipping_address_id->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->isInvalid->Visible) { // isInvalid ?>
		<td<?php echo $transaction->isInvalid->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<select id="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" name="x<?php echo $transaction_grid->RowIndex ?>_isInvalid"<?php echo $transaction->isInvalid->EditAttributes() ?>>
<?php
if (is_array($transaction->isInvalid->EditValue)) {
	$arwrk = $transaction->isInvalid->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->isInvalid->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $transaction->isInvalid->OldValue = "";
?>
</select>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_isInvalid" id="o<?php echo $transaction_grid->RowIndex ?>_isInvalid" value="<?php echo ew_HtmlEncode($transaction->isInvalid->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $transaction->isInvalid->ViewAttributes() ?>><?php echo $transaction->isInvalid->EditValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" id="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" value="<?php echo ew_HtmlEncode($transaction->isInvalid->CurrentValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->isInvalid->ViewAttributes() ?>><?php echo $transaction->isInvalid->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" id="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" value="<?php echo ew_HtmlEncode($transaction->isInvalid->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_isInvalid" id="o<?php echo $transaction_grid->RowIndex ?>_isInvalid" value="<?php echo ew_HtmlEncode($transaction->isInvalid->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->remarks->Visible) { // remarks ?>
		<td<?php echo $transaction->remarks->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<textarea name="x<?php echo $transaction_grid->RowIndex ?>_remarks" id="x<?php echo $transaction_grid->RowIndex ?>_remarks" cols="70" rows="6"<?php echo $transaction->remarks->EditAttributes() ?>><?php echo $transaction->remarks->EditValue ?></textarea>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_remarks" id="o<?php echo $transaction_grid->RowIndex ?>_remarks" value="<?php echo ew_HtmlEncode($transaction->remarks->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<textarea name="x<?php echo $transaction_grid->RowIndex ?>_remarks" id="x<?php echo $transaction_grid->RowIndex ?>_remarks" cols="70" rows="6"<?php echo $transaction->remarks->EditAttributes() ?>><?php echo $transaction->remarks->EditValue ?></textarea>
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->remarks->ViewAttributes() ?>><?php echo $transaction->remarks->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_remarks" id="x<?php echo $transaction_grid->RowIndex ?>_remarks" value="<?php echo ew_HtmlEncode($transaction->remarks->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_remarks" id="o<?php echo $transaction_grid->RowIndex ?>_remarks" value="<?php echo ew_HtmlEncode($transaction->remarks->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->consignment_no->Visible) { // consignment_no ?>
		<td<?php echo $transaction->consignment_no->CellAttributes() ?>>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" size="70" maxlength="255" value="<?php echo $transaction->consignment_no->EditValue ?>"<?php echo $transaction->consignment_no->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="o<?php echo $transaction_grid->RowIndex ?>_consignment_no" value="<?php echo ew_HtmlEncode($transaction->consignment_no->OldValue) ?>">
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" size="70" maxlength="255" value="<?php echo $transaction->consignment_no->EditValue ?>"<?php echo $transaction->consignment_no->EditAttributes() ?>>
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $transaction->consignment_no->ViewAttributes() ?>><?php echo $transaction->consignment_no->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" value="<?php echo ew_HtmlEncode($transaction->consignment_no->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="o<?php echo $transaction_grid->RowIndex ?>_consignment_no" value="<?php echo ew_HtmlEncode($transaction->consignment_no->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$transaction_grid->ListOptions->Render("body", "right");
?>
	</tr>
<?php if ($transaction->RowType == EW_ROWTYPE_ADD) { ?>
<?php } ?>
<?php if ($transaction->RowType == EW_ROWTYPE_EDIT) { ?>
<?php } ?>
<?php
	}
	} // End delete row checking
	if ($transaction->CurrentAction <> "gridadd" || $transaction->CurrentMode == "copy")
		if (!$transaction_grid->Recordset->EOF) $transaction_grid->Recordset->MoveNext();
}
?>
<?php
	if ($transaction->CurrentMode == "add" || $transaction->CurrentMode == "copy" || $transaction->CurrentMode == "edit") {
		$transaction_grid->RowIndex = '$rowindex$';
		$transaction_grid->LoadDefaultValues();

		// Set row properties
		$transaction->ResetAttrs();
		$transaction->RowAttrs = array();
		if (!empty($transaction_grid->RowIndex))
			$transaction->RowAttrs = array_merge($transaction->RowAttrs, array('data-rowindex'=>$transaction_grid->RowIndex, 'id'=>'r' . $transaction_grid->RowIndex . '_transaction'));
		$transaction->RowType = EW_ROWTYPE_ADD;

		// Render row
		$transaction_grid->RenderRow();

		// Render list options
		$transaction_grid->RenderListOptions();

		// Add id and class to the template row
		$transaction->RowAttrs["id"] = "r0_transaction";
		ew_AppendClass($transaction->RowAttrs["class"], "ewTemplate");
?>
	<tr<?php echo $transaction->RowAttributes() ?>>
<?php

// Render list options (body, left)
$transaction_grid->ListOptions->Render("body", "left");
?>
	<?php if ($transaction->order_no->Visible) { // order_no ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_order_no" id="x<?php echo $transaction_grid->RowIndex ?>_order_no" size="70" maxlength="255" value="<?php echo $transaction->order_no->EditValue ?>"<?php echo $transaction->order_no->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->order_no->ViewAttributes() ?>><?php echo $transaction->order_no->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_order_no" id="x<?php echo $transaction_grid->RowIndex ?>_order_no" value="<?php echo ew_HtmlEncode($transaction->order_no->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->user_id->Visible) { // user_id ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<?php if ($transaction->user_id->getSessionValue() <> "") { ?>
<div<?php echo $transaction->user_id->ViewAttributes() ?>><?php echo $transaction->user_id->ListViewValue() ?></div>
<input type="hidden" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->CurrentValue) ?>">
<?php } else { ?>
<span id="as_x<?php echo $transaction_grid->RowIndex ?>_user_id" style="white-space: nowrap; z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>">
	<input type="text" name="sv_x<?php echo $transaction_grid->RowIndex ?>_user_id" id="sv_x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $transaction->user_id->EditValue ?>" size="70"<?php echo $transaction->user_id->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $transaction_grid->RowIndex ?>_user_id" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $transaction_grid->RowIndex ?>_user_id" style="z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>"></div>
</span>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $transaction->user_id->CurrentValue ?>">
<?php
 $sSqlWrk = "SELECT `id`, `username`, `name`, `no_ahli` FROM `user`";
 $sWhereWrk = "`username`  LIKE '{query_value}%'";
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
	$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x<?php echo $transaction_grid->RowIndex ?>_user_id" id="s_x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo $sSqlWrk ?>">
<script type="text/javascript">
<!--
var oas_x<?php echo $transaction_grid->RowIndex ?>_user_id = new ew_AutoSuggest("sv_x<?php echo $transaction_grid->RowIndex ?>_user_id", "sc_x<?php echo $transaction_grid->RowIndex ?>_user_id", "s_x<?php echo $transaction_grid->RowIndex ?>_user_id", "em_x<?php echo $transaction_grid->RowIndex ?>_user_id", "x<?php echo $transaction_grid->RowIndex ?>_user_id", "", false, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas_x<?php echo $transaction_grid->RowIndex ?>_user_id.formatResult = function(ar) {	
	var df1 = ar[1];
	var df2 = ar[2];
	if (df2 != "")
		df1 += EW_FIELD_SEP + df2;
	var df3 = ar[3];
	if (df3 != "")
		df1 += EW_FIELD_SEP + df3;
	return df1;
};
oas_x<?php echo $transaction_grid->RowIndex ?>_user_id.ac.typeAhead = false;

//-->
</script>
<?php } ?>
<?php } else { ?>
<div<?php echo $transaction->user_id->ViewAttributes() ?>><?php echo $transaction->user_id->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_user_id" id="x<?php echo $transaction_grid->RowIndex ?>_user_id" value="<?php echo ew_HtmlEncode($transaction->user_id->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->amount->Visible) { // amount ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_amount" id="x<?php echo $transaction_grid->RowIndex ?>_amount" size="30" maxlength="255" value="<?php echo $transaction->amount->EditValue ?>"<?php echo $transaction->amount->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->amount->ViewAttributes() ?>><?php echo $transaction->amount->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_amount" id="x<?php echo $transaction_grid->RowIndex ?>_amount" value="<?php echo ew_HtmlEncode($transaction->amount->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->status_payment->Visible) { // status_payment ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_status_payment" id="x<?php echo $transaction_grid->RowIndex ?>_status_payment" size="30" maxlength="255" value="<?php echo $transaction->status_payment->EditValue ?>"<?php echo $transaction->status_payment->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->status_payment->ViewAttributes() ?>><?php echo $transaction->status_payment->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_status_payment" id="x<?php echo $transaction_grid->RowIndex ?>_status_payment" value="<?php echo ew_HtmlEncode($transaction->status_payment->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->status_transaction->Visible) { // status_transaction ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<div id="tp_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="{value}"<?php echo $transaction->status_transaction->EditAttributes() ?>></label></div>
<div id="dsl_x<?php echo $transaction_grid->RowIndex ?>_status_transaction" data-repeatcolumn="5" class="ewItemList">
<?php
$arwrk = $transaction->status_transaction->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->status_transaction->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;

		// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $transaction->status_transaction->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
if (@$emptywrk) $transaction->status_transaction->OldValue = "";
?>
</div>
<?php } else { ?>
<div<?php echo $transaction->status_transaction->ViewAttributes() ?>><?php echo $transaction->status_transaction->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" id="x<?php echo $transaction_grid->RowIndex ?>_status_transaction" value="<?php echo ew_HtmlEncode($transaction->status_transaction->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->total_item->Visible) { // total_item ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_total_item" id="x<?php echo $transaction_grid->RowIndex ?>_total_item" size="30" maxlength="255" value="<?php echo $transaction->total_item->EditValue ?>"<?php echo $transaction->total_item->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->total_item->ViewAttributes() ?>><?php echo $transaction->total_item->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_item" id="x<?php echo $transaction_grid->RowIndex ?>_total_item" value="<?php echo ew_HtmlEncode($transaction->total_item->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->total_weight->Visible) { // total_weight ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_total_weight" id="x<?php echo $transaction_grid->RowIndex ?>_total_weight" size="30" value="<?php echo $transaction->total_weight->EditValue ?>"<?php echo $transaction->total_weight->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->total_weight->ViewAttributes() ?>><?php echo $transaction->total_weight->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_total_weight" id="x<?php echo $transaction_grid->RowIndex ?>_total_weight" value="<?php echo ew_HtmlEncode($transaction->total_weight->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->postage_price->Visible) { // postage_price ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_postage_price" id="x<?php echo $transaction_grid->RowIndex ?>_postage_price" size="30" value="<?php echo $transaction->postage_price->EditValue ?>"<?php echo $transaction->postage_price->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->postage_price->ViewAttributes() ?>><?php echo $transaction->postage_price->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_postage_price" id="x<?php echo $transaction_grid->RowIndex ?>_postage_price" value="<?php echo ew_HtmlEncode($transaction->postage_price->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->items_price->Visible) { // items_price ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_items_price" id="x<?php echo $transaction_grid->RowIndex ?>_items_price" size="30" value="<?php echo $transaction->items_price->EditValue ?>"<?php echo $transaction->items_price->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->items_price->ViewAttributes() ?>><?php echo $transaction->items_price->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_items_price" id="x<?php echo $transaction_grid->RowIndex ?>_items_price" value="<?php echo ew_HtmlEncode($transaction->items_price->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->type_price->Visible) { // type_price ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<div id="tp_x<?php echo $transaction_grid->RowIndex ?>_type_price" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="{value}"<?php echo $transaction->type_price->EditAttributes() ?>></label></div>
<div id="dsl_x<?php echo $transaction_grid->RowIndex ?>_type_price" data-repeatcolumn="5" class="ewItemList">
<?php
$arwrk = $transaction->type_price->EditValue;
if (is_array($arwrk)) {
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->type_price->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;

		// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $transaction->type_price->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
	}
}
if (@$emptywrk) $transaction->type_price->OldValue = "";
?>
</div>
<?php } else { ?>
<div<?php echo $transaction->type_price->ViewAttributes() ?>><?php echo $transaction->type_price->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_type_price" id="x<?php echo $transaction_grid->RowIndex ?>_type_price" value="<?php echo ew_HtmlEncode($transaction->type_price->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->shipping_address_id->Visible) { // shipping_address_id ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<span id="as_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" style="white-space: nowrap; z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>">
	<input type="text" name="sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $transaction->shipping_address_id->EditValue ?>" size="30"<?php echo $transaction->shipping_address_id->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" style="z-index: <?php echo (9000 - $transaction_grid->RowIndex * 10) ?>"></div>
</span>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $transaction->shipping_address_id->CurrentValue ?>">
<?php
 $sSqlWrk = "SELECT `id`, `address`, `poskod`, `city` FROM `address`";
 $sWhereWrk = "`address`  LIKE '{query_value}%'";
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
	$sSqlWrk = TEAencrypt($sSqlWrk, EW_RANDOM_KEY);
?>
<input type="hidden" name="s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo $sSqlWrk ?>">
<script type="text/javascript">
<!--
var oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id = new ew_AutoSuggest("sv_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "sc_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "s_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "em_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id", "", false, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id.formatResult = function(ar) {	
	var df1 = ar[1];
	var df2 = ar[2];
	if (df2 != "")
		df1 += EW_FIELD_SEP + df2;
	var df3 = ar[3];
	if (df3 != "")
		df1 += EW_FIELD_SEP + df3;
	return df1;
};
oas_x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id.ac.typeAhead = false;

//-->
</script>
<?php } else { ?>
<div<?php echo $transaction->shipping_address_id->ViewAttributes() ?>><?php echo $transaction->shipping_address_id->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" id="x<?php echo $transaction_grid->RowIndex ?>_shipping_address_id" value="<?php echo ew_HtmlEncode($transaction->shipping_address_id->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->isInvalid->Visible) { // isInvalid ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<select id="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" name="x<?php echo $transaction_grid->RowIndex ?>_isInvalid"<?php echo $transaction->isInvalid->EditAttributes() ?>>
<?php
if (is_array($transaction->isInvalid->EditValue)) {
	$arwrk = $transaction->isInvalid->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($transaction->isInvalid->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $transaction->isInvalid->OldValue = "";
?>
</select>
<?php } else { ?>
<div<?php echo $transaction->isInvalid->ViewAttributes() ?>><?php echo $transaction->isInvalid->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" id="x<?php echo $transaction_grid->RowIndex ?>_isInvalid" value="<?php echo ew_HtmlEncode($transaction->isInvalid->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->remarks->Visible) { // remarks ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<textarea name="x<?php echo $transaction_grid->RowIndex ?>_remarks" id="x<?php echo $transaction_grid->RowIndex ?>_remarks" cols="70" rows="6"<?php echo $transaction->remarks->EditAttributes() ?>><?php echo $transaction->remarks->EditValue ?></textarea>
<?php } else { ?>
<div<?php echo $transaction->remarks->ViewAttributes() ?>><?php echo $transaction->remarks->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_remarks" id="x<?php echo $transaction_grid->RowIndex ?>_remarks" value="<?php echo ew_HtmlEncode($transaction->remarks->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($transaction->consignment_no->Visible) { // consignment_no ?>
		<td>
<?php if ($transaction->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" size="70" maxlength="255" value="<?php echo $transaction->consignment_no->EditValue ?>"<?php echo $transaction->consignment_no->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $transaction->consignment_no->ViewAttributes() ?>><?php echo $transaction->consignment_no->ViewValue ?></div>
<input type="hidden" name="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" id="x<?php echo $transaction_grid->RowIndex ?>_consignment_no" value="<?php echo ew_HtmlEncode($transaction->consignment_no->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$transaction_grid->ListOptions->Render("body", "right");
?>
	</tr>
<?php
}
?>
</tbody>
</table>
<?php if ($transaction->CurrentMode == "add" || $transaction->CurrentMode == "copy") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridinsert">
<input type="hidden" name="key_count" id="key_count" value="<?php echo $transaction_grid->KeyCount ?>">
<?php echo $transaction_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($transaction->CurrentMode == "edit") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridupdate">
<input type="hidden" name="key_count" id="key_count" value="<?php echo $transaction_grid->KeyCount ?>">
<?php echo $transaction_grid->MultiSelectKey ?>
<?php } ?>
<input type="hidden" name="detailpage" id="detailpage" value="transaction_grid">
</div>
<?php

// Close recordset
if ($transaction_grid->Recordset)
	$transaction_grid->Recordset->Close();
?>
<?php if (($transaction->CurrentMode == "add" || $transaction->CurrentMode == "copy" || $transaction->CurrentMode == "edit") && $transaction->CurrentAction != "F") { // add/copy/edit mode ?>
<div class="ewGridLowerPanel">
</div>
<?php } ?>
</td></tr></table>
<?php if ($transaction->Export == "" && $transaction->CurrentAction == "") { ?>
<?php } ?>
<?php
$transaction_grid->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<?php
$transaction_grid->Page_Terminate();
$Page =& $MasterPage;
?>
